<template>
	<view class="content" v-if="show==1">
		<view class="top">
			<view class="top_head">
				<image :src="user.avatar" mode="aspectFill"></image>
				<view class="head2">
					<view class="head3">{{user.nickname}}</view>
					<view class="head4">编号：S{{user.id}}</view>
				</view>
			</view>
		    <view class="top_1">
		      <view class="yue">
		        <view class="yue_1">
		          <view class="mingcheng">账户余额(元)</view>
		          <view class="qian">{{user.money}}</view>
		        </view>
		      </view>
			  <view class="yue">
			    <view class="yue_1">
			      <view class="mingcheng">累计收益(元)</view>
			      <view class="qian">{{user.total}}</view>
			    </view>
			  </view>
		    </view>
		</view>
		<view class="order" >
			<view class="dao" @click="url" data-url="/pages/teacher/tixian">
				<image src="../../static/laoshi/tixian.png" class="tubiao" mode="aspectFit"></image>
				<view class="dao2">我要提现</view>
				<image src="../../static/images/right_2.png" class="tubiao2" mode="aspectFit"></image>
			</view>
			<view class="dao" @click="url" data-url="/pages/teacher/txlists">
				<image src="../../static/laoshi/jilu.png" class="tubiao" mode="aspectFit"></image>
				<view class="dao2">提现记录</view>
				<image src="../../static/images/right_2.png" class="tubiao2" mode="aspectFit"></image>
			</view>
			<view class="dao" @click="url" data-url="/pages/teacher/log">
				<image src="../../static/laoshi/caiwu.png" class="tubiao" mode="aspectFit"></image>
				<view class="dao2">财务明细</view>
				<image src="../../static/images/right_2.png" class="tubiao2" mode="aspectFit"></image>
			</view>
		</view>
	</view>
</template>

<script>
	var app=getApp();
	
	export default {
		data() {
			return {
				show:0,
				uid:0,
				user:[]
			}
		},
		onShow() {
			const uid = uni.getStorageSync('uid');
			if(app.isBlank(uid)==true){
				app.error_msg("请先登录");
			}
			this.uid=uid;
			this.getdata();
		},
		methods: {
			getdata(){
				var that=this;
				/*uni.showLoading({
				    title: '数据加载中'
				});*/
				uni.request({
				    url: app.globalData.url+"laoshi/money",
					method:"POST",
					dataType:"json",
					header: {
					    'content-type': 'application/x-www-form-urlencoded'
					},
				    data: {uid:that.uid},
				    success: (res) => {
						uni.hideLoading();
						if(res.data.code!=1){
							app.error_msg(res.data.msg);
						}
						that.user=res.data.data.user
						
						that.show=1;
				    }
				});
			},
			url(e){
				var url=e.currentTarget.dataset.url;
				uni.navigateTo({
				    url: url
				});
			}
		}
	}
</script>

<style>
	.shangsi2{width:90%;height:30px;line-height: 30px;margin: 0px auto;overflow: hidden;}
	.shangsi image{width:80px;height:80px;border-radius: 50%;margin-top: 20px;}
	.shangsi{width:200px;height:150px;position: fixed;top:50%;margin-top: -75px;left:50%;margin-left: -100px;background-color: #fff;border-radius: 5px;z-index: 9999;text-align: center;}
	.nav2-1{width:100%;height:25px;line-height: 25px;font-size: 0.9rem;}
	.nav2 image{width:30px;height:30px;}
	.nav2{width:33.33%;float: left;text-align: center;margin-top: 25px;}
	.nav{width:100%;overflow: hidden;}
	
	.head4{width:100%;height:30px;line-height: 30px;color:#fff;overflow: hidden;}
	.head3{width:100%;height:30px;line-height: 30px;font-size: 0.95rem;color:#fff;overflow: hidden;}
	.head2{width:100%;height:60px;flex:1;}
	.top_head image{width:60px;height:60px;margin-right: 10px;border-radius: 50%;}
	.top_head{width:95%;display: flex;margin: 0 auto;margin-top: 15px;}
	
	.dao2 text{color:red;font-size: 0.7rem;margin-left: 5px;float: right;}
	.dao:last-child{border:0px;}
	.tubiao2{width:20px;height:20px;margin-top: 11.5px;}
	.dao2{width:100%;height:43px;line-height: 43px;flex:1;font-size: 0.9rem;}
	.tubiao{width:20px;height:20px;margin-top: 11.5px;margin-right: 8px;}
	.dao{width:94%;padding: 3px 3%;display: flex;height:43px;border-bottom:1px rgb(245, 245, 245) solid;}
	.order{width:100%;margin-top: 20px;}
	.kong{width:100%;text-align: center;margin-top: 30%;}
	.active{border-bottom: 2px #05c160 solid;color:#05c160;}
	.qian2{width:40%;margin:0px 5%;height:30px;line-height: 30px;text-align: center;float: left;}
	.qian1{width:100%;overflow: hidden;}
	.bottom{width:94%;padding: 0px 3%;}
	.sign_1{width:100%;overflow: hidden;padding: 10px 0px;border-bottom: 1px rgb(245, 245, 245) solid;overflow: hidden;}
	.time{width:70%;float: left;height:50px;}
	.jifen2{width:30%;float: left;height:50px;line-height: 50px;color:rgb(7, 207, 33);font-size: 0.9rem;text-align: right;}
	.time_1{width:100%;height:30px;line-height: 30px;font-size: 0.8rem;color:#666;overflow: hidden;}
	.time_2{width:100%;height:30px;line-height: 20px;color:#999;}
	.red{color:red!important;}
	.top{width:94%;padding: 0px 3%;background-color: #05c160;}
	.top_1{width:100%;height:auto;overflow: hidden;padding-top: 20px;}
	.yue{width:46%;padding: 15px 2%;overflow: hidden;float: left;}
	.yue_1{width:100%;}
	.yue_2{width:30%;float: left;text-align: right;margin-top: 13px;}
	.mingcheng{width:100%;height:20px;line-height: 20px;color:#eee;text-align: center;}
	.qian{width:100%;height:35px;line-height: 35px;color:#fff;font-size: 1.5rem;overflow: hidden;text-align: center;}
	
</style>
